<html>
<head><meta charset="utf-8"><title>Json IDs · rustdoc · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/index.html">rustdoc</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Json.20IDs.html">Json IDs</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="223404404"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Json%20IDs/near/223404404" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Json.20IDs.html#223404404">(Jan 20 2021 at 17:13)</a>:</h4>
<p>Looking into <a href="https://github.com/rust-lang/rust/issues/80664#issuecomment-753681341">This comment</a>. From what I understand, the issue is that a DefId is based on the compiler's understanding of what is public, while a HirId is based on items, but HirId isn't available to external items and DefId won't work right with items marked public in multiple locations but only visible from one?</p>



<a name="223404942"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Json%20IDs/near/223404942" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Json.20IDs.html#223404942">(Jan 20 2021 at 17:18)</a>:</h4>
<p><span class="user-mention" data-user-id="319144">@CraftSpider</span> the issue is that, while HirId and DefIds have overlap, neither is a proper subset of the other</p>



<a name="223405019"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Json%20IDs/near/223405019" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Json.20IDs.html#223405019">(Jan 20 2021 at 17:18)</a>:</h4>
<p>not all HirIds are serialized cross-crate, and HirIds are only available in the local crate</p>



<a name="223405086"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Json%20IDs/near/223405086" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Json.20IDs.html#223405086">(Jan 20 2021 at 17:19)</a>:</h4>
<p>So basically, JSON is trying to represent a concept that neither is quite right for</p>



<a name="223405112"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Json%20IDs/near/223405112" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Json.20IDs.html#223405112">(Jan 20 2021 at 17:19)</a>:</h4>
<p>yes</p>



<a name="223405600"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Json%20IDs/near/223405600" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Json.20IDs.html#223405600">(Jan 20 2021 at 17:23)</a>:</h4>
<p>Alright, time to stare at the code for a bit, then brainstorm solutions, unless you already have a specific one in mind?</p>



<a name="223406049"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Json%20IDs/near/223406049" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Json.20IDs.html#223406049">(Jan 20 2021 at 17:27)</a>:</h4>
<p>the issue I think is that rustdoc is exposing too much information</p>



<a name="223406069"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Json%20IDs/near/223406069" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Json.20IDs.html#223406069">(Jan 20 2021 at 17:27)</a>:</h4>
<p>if we could just serialize DefIds without HirIds it would be fine</p>



<a name="223406081"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Json%20IDs/near/223406081" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Json.20IDs.html#223406081">(Jan 20 2021 at 17:27)</a>:</h4>
<p>and I would prefer to do that rather than a JsonID or whatever</p>



<a name="223406303"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Json%20IDs/near/223406303" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Json.20IDs.html#223406303">(Jan 20 2021 at 17:29)</a>:</h4>
<p>sorry I keep changing my mind on this</p>



<a name="223406320"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Json%20IDs/near/223406320" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Json.20IDs.html#223406320">(Jan 20 2021 at 17:29)</a>:</h4>
<p>cc <span class="user-mention" data-user-id="268539">@Nixon Enraght-Moony</span></p>



<a name="223406397"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Json%20IDs/near/223406397" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Json.20IDs.html#223406397">(Jan 20 2021 at 17:30)</a>:</h4>
<p>What do you mean? HirId is currently unused in the JSON. Do you mean similar to the solution proposed in the original issue, just don't document the unreachable items, or something entirely different?</p>



<a name="223406535"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Json%20IDs/near/223406535" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Json.20IDs.html#223406535">(Jan 20 2021 at 17:30)</a>:</h4>
<p>yes, don't document things that don't have a DefId</p>



<a name="223406582"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Json%20IDs/near/223406582" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Json.20IDs.html#223406582">(Jan 20 2021 at 17:31)</a>:</h4>
<p>hmm, I guess this breaks anyone that wants to do similar things to rustdoc and show  the item at that scope</p>



<a name="223406593"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Json%20IDs/near/223406593" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Json.20IDs.html#223406593">(Jan 20 2021 at 17:31)</a>:</h4>
<p>how does rustdoc even handle this?</p>



<a name="223406907"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Json%20IDs/near/223406907" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Json.20IDs.html#223406907">(Jan 20 2021 at 17:33)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="w">        </span><span class="c1">// Stripped modules survive the rustdoc passes (i.e., `strip-private`)</span>
<span class="w">        </span><span class="c1">// if they contain impls for public types. These modules can also</span>
<span class="w">        </span><span class="c1">// contain items such as publicly re-exported structures.</span>
<span class="w">        </span><span class="c1">//</span>
<span class="w">        </span><span class="c1">// External crates will provide links to these structures, so</span>
<span class="w">        </span><span class="c1">// these modules are recursed into, but not rendered normally</span>
<span class="w">        </span><span class="c1">// (a flag on the context).</span>
<span class="w">        </span><span class="k">if</span><span class="w"> </span><span class="o">!</span><span class="bp">self</span><span class="p">.</span><span class="n">render_redirect_pages</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">            </span><span class="bp">self</span><span class="p">.</span><span class="n">render_redirect_pages</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">item</span><span class="p">.</span><span class="n">is_stripped</span><span class="p">();</span><span class="w"></span>
<span class="w">        </span><span class="p">}</span><span class="w"></span>
</code></pre></div>
<p>Appears in <code>html/render/mod.rs</code>, which sounds relevant</p>



<a name="223407530"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Json%20IDs/near/223407530" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Json.20IDs.html#223407530">(Jan 20 2021 at 17:39)</a>:</h4>
<p><code>is_stripped</code> seems to special case ImportItems, referencing <code>!i.should_be_displayed</code>. The handling of <code>render_redirect_pages</code> is spread across multiple places, but in one place relates to whether rendering does <code>layout::render</code> or <code>layout::redirect</code>.</p>



<a name="223407663"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Json%20IDs/near/223407663" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Json.20IDs.html#223407663">(Jan 20 2021 at 17:40)</a>:</h4>
<p><span class="user-mention" data-user-id="319144">@CraftSpider</span> right, but that's not really what I mean - I want to make sure info for doing this is <em>available</em> to other tools if they want it</p>



<a name="223407685"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Json%20IDs/near/223407685" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Json.20IDs.html#223407685">(Jan 20 2021 at 17:40)</a>:</h4>
<p>Not necessarily that they use the same logic</p>



<a name="223407782"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Json%20IDs/near/223407782" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Json.20IDs.html#223407782">(Jan 20 2021 at 17:41)</a>:</h4>
<p>So I guess that does mean it needs a separate id, one that represents both HIR and DefIds</p>



<a name="223407857"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Json%20IDs/near/223407857" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Json.20IDs.html#223407857">(Jan 20 2021 at 17:42)</a>:</h4>
<p>Yeah. If we want to preserve this information we need a new ID, unless one wants to add some kind of optional 're-exported by' field</p>



<a name="223408012"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Json%20IDs/near/223408012" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Json.20IDs.html#223408012">(Jan 20 2021 at 17:43)</a>:</h4>
<p>Hmm, that might be easier for the consumer</p>



<a name="223408049"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Json%20IDs/near/223408049" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Json.20IDs.html#223408049">(Jan 20 2021 at 17:43)</a>:</h4>
<p><span class="user-mention" data-user-id="229913">@HeroicKatora</span> weren't you planning to use the JSON backend for something?</p>



<a name="223408068"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Json%20IDs/near/223408068" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Json.20IDs.html#223408068">(Jan 20 2021 at 17:43)</a>:</h4>
<p>How would you prefer to expose info about re-exports?</p>



<a name="223408376"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Json%20IDs/near/223408376" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> HeroicKatora <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Json.20IDs.html#223408376">(Jan 20 2021 at 17:45)</a>:</h4>
<p>Yep, already started but haven't gotten far. So basically, parsing the json and generating markdown/tex</p>



<a name="223408436"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Json%20IDs/near/223408436" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Json.20IDs.html#223408436">(Jan 20 2021 at 17:45)</a>:</h4>
<p>Oh wow, nice!</p>



<a name="223408509"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Json%20IDs/near/223408509" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Json.20IDs.html#223408509">(Jan 20 2021 at 17:46)</a>:</h4>
<p>Oh, nice</p>



<a name="223408535"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Json%20IDs/near/223408535" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Json.20IDs.html#223408535">(Jan 20 2021 at 17:46)</a>:</h4>
<p>I presume you <em>want</em> to know about re-exports, right? This is really easy on our end if we just delete that and only emit the canonical definition lol</p>



<a name="223408668"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Json%20IDs/near/223408668" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Json.20IDs.html#223408668">(Jan 20 2021 at 17:47)</a>:</h4>
<p>Haha. I think in terms of ease, 'ignoring re-exports' &lt; 're-exported at field' &lt; 'custom IDs' :P</p>



<a name="223408918"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Json%20IDs/near/223408918" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> HeroicKatora <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Json.20IDs.html#223408918">(Jan 20 2021 at 17:49)</a>:</h4>
<p>Yeah, I'd prefer to know. I believe something similar to typedefs would fit best.</p>



<a name="223408967"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Json%20IDs/near/223408967" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> HeroicKatora <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Json.20IDs.html#223408967">(Jan 20 2021 at 17:49)</a>:</h4>
<p>I'll have to consider it for a bit though and eat, let me get back to you in a bit</p>



<a name="223450426"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Json%20IDs/near/223450426" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nixon Enraght-Moony <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Json.20IDs.html#223450426">(Jan 20 2021 at 23:11)</a>:</h4>
<p><span class="user-mention silent" data-user-id="229913">HeroicKatora</span> <a href="#narrow/stream/266220-rustdoc/topic/Json.20IDs/near/223408376">said</a>:</p>
<blockquote>
<p>Yep, already started but haven't gotten far. So basically, parsing the json and generating markdown/tex</p>
</blockquote>
<p>If this is public, can you send the link?</p>



<a name="223687131"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Json%20IDs/near/223687131" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Json.20IDs.html#223687131">(Jan 22 2021 at 19:28)</a>:</h4>
<p><span class="user-mention" data-user-id="229913">@HeroicKatora</span> Any updates on this?</p>



<a name="223744382"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Json%20IDs/near/223744382" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> HeroicKatora <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Json.20IDs.html#223744382">(Jan 23 2021 at 11:13)</a>:</h4>
<p><a href="https://github.com/oberien/heradoc/tree/rustdoc/src/frontend/rustdoc">https://github.com/oberien/heradoc/tree/rustdoc/src/frontend/rustdoc</a><br>
That's the repository and branch, I'm not pushing regularly as I'm not very certain of the implementation yet ;)</p>



<a name="223752978"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Json%20IDs/near/223752978" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Json.20IDs.html#223752978">(Jan 23 2021 at 14:46)</a>:</h4>
<blockquote>
<p><a href="http://types.rs">types.rs</a></p>
</blockquote>
<p>FYI we plan to make this a separate crate shortly so you can reuse exactly the same types rustdoc uses: <a href="https://github.com/rust-lang/rust/pull/81287">https://github.com/rust-lang/rust/pull/81287</a></p>



<a name="223753153"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Json%20IDs/near/223753153" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Json.20IDs.html#223753153">(Jan 23 2021 at 14:51)</a>:</h4>
<blockquote>
<p>target.push("doc");</p>
</blockquote>
<p>This can be wrong if the docs are cross compiled, or if a crate has <code>doc = false</code> set. Unfortunately I don't know a more accurate way without building the docs yourself. There's an example of that here: <a href="https://github.com/deadlinks/cargo-deadlinks/blob/3e984d56e4e6e92e6ae31d8a09758e57f55fdaa3/src/bin/cargo-deadlinks.rs#L210">https://github.com/deadlinks/cargo-deadlinks/blob/3e984d56e4e6e92e6ae31d8a09758e57f55fdaa3/src/bin/cargo-deadlinks.rs#L210</a></p>



<a name="223753237"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Json%20IDs/near/223753237" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Json.20IDs.html#223753237">(Jan 23 2021 at 14:52)</a>:</h4>
<p>I might publish a non-official library for writing rustdoc plugins</p>



<a name="223814021"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Json%20IDs/near/223814021" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Json.20IDs.html#223814021">(Jan 24 2021 at 13:28)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> <a href="#narrow/stream/266220-rustdoc/topic/Json.20IDs/near/223753237">said</a>:</p>
<blockquote>
<p>I might publish a non-official library for writing rustdoc plugins</p>
</blockquote>
<p><span class="user-mention" data-user-id="229913">@HeroicKatora</span> if I made this, would you be interested in using it? mostly it would be refactoring things out of cargo-deadlinks so it wouldn't be a ton of work on my end</p>



<a name="223815950"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Json%20IDs/near/223815950" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> HeroicKatora <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Json.20IDs.html#223815950">(Jan 24 2021 at 14:16)</a>:</h4>
<p>As a real plugins? Not necessarily. Consuming the json output is okay and retaining control over the execution as a separate process works fine as well. Also I'm not interested in injecting more sources for link resolution (in fact that's pretty much a non-goal for the convertion I'm writing). At least not at the moment. But I'm not too sure about it yet. Maybe something for intra-doc links comes up that can't be easily solved by translating links, or I might need to influence the way it constructs IDs.</p>



<a name="223815998"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Json%20IDs/near/223815998" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Json.20IDs.html#223815998">(Jan 24 2021 at 14:16)</a>:</h4>
<p>not as in buliding from source, just like an easy way to wrap <code>cargo rustdoc</code></p>



<a name="223816382"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Json%20IDs/near/223816382" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> HeroicKatora <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Json.20IDs.html#223816382">(Jan 24 2021 at 14:26)</a>:</h4>
<p>That might be more interesting.  In particular, getting the file name of the json output etc. and program options? Might be cool to discover how to use it best and what else exists for using the doc tool.</p>



<a name="223816406"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Json%20IDs/near/223816406" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Json.20IDs.html#223816406">(Jan 24 2021 at 14:26)</a>:</h4>
<p>I would have a <code>rustdoc_args</code> to pass things directly I think, otherwise it would get out of date rapidly</p>



<a name="223816413"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/Json%20IDs/near/223816413" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/Json.20IDs.html#223816413">(Jan 24 2021 at 14:27)</a>:</h4>
<p>but the main benefit is you wouldn't have to guess where cargo is outputting the docs</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>